<script setup>
import wangeditorUtil from "@/components/utils/wangeditor-util.vue";
import {ref, inject, defineProps,reactive, defineModel, provide,defineExpose} from "vue";
const {toPage} = inject("toPage")
// const {saveNoteClick} = inject("saveNoteClick")
//组件通信，配置传值
const props = defineProps({
  showBoeder:{
    type:String,
    default:"1px"
  },
  section:{
    required: false,
    type: String,
    default:"<p>你好！你需要填写的笔记内容</p>"
  },
  title: {
    required: false,
    type: String,
    default: '未设置标题'
  }
})
function back(){
  history.go(-1)
}
function classSave(){

}
const wangedterRef =ref(null)

// function getxxx(param) {
//   saveNoteClick(param)
// }
// provide('getxxx',{ getxxx })

//访问demo组件的方法或对象
//调用子组件的 play方法
const onTry = () => wangedterRef.value.fxxx();

defineExpose({
  onTry
})
</script>

<template>
  <n-flex vertical class="write">

    <n-space vertical class="write-content">
      <wangeditor-util
          ref="wangedterRef"
          :border-px="props.showBoeder"
          :section-value="props.section"
      />
    </n-space>
  </n-flex>
</template>

<style lang="scss" scoped>
.write{
  position: relative;
}
.write-title{
  font-size: 2rem;
  font-weight: bold;
}
.write-content{
  min-height: 24rem;
}
</style>
